<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>

<div id="rightPan">
	<div id="rightbodyPan">
		<div align="center"><p style=" font-size: 24px; padding: 10px 0 5px 0;" >สายจูงสุนัข</p></div>
		<div id="headerTab">
			<a style="width: 70px;" id="clicked">เพิ่มสินค้า</a>
			<a style="width: 80px;" href="<s:url action="leash_get" namespace="/product"/>">เรียกดูข้อมูล</a>
		</div>
		
		<script type="text/javascript">
			function add(){
				document.getElementById( 'leash_add' ).submit();
			}
			
			function selectBrand( value ){
				if ( value != -1 ){
					document.getElementById("newBrand").disabled = true;
					document.getElementById("newBrand").value = "";
				}
				else{
					document.getElementById("newBrand").disabled = false;
				}
			}
		</script>
	    
		<s:form id="leash_add" action="leash_add" theme="simple">
			<table>
				<tr>
					<td style="padding-top: 30px;" id="slabel">ชื่อ:<span>*</span></td>
					<td style="padding-top: 30px;"><s:textfield key="leash.name" maxLength="100" size="40"/></td>
				</tr>
				<tr>
					<td id="slabel">ยี่ห้อ:</td>
					<td><s:select list="selectBrand" key="leash.brand" onchange="selectBrand(this.value)" headerKey="-1" headerValue=""/>
					<s:textfield name="leash.newBrand" size="25" id="newBrand"/></td>
				</tr>
				<tr>
					<td id="slabel">รายละเอียด:<span>*</span></td>
					<td><s:textarea style="width: 380px; height: 80px;" key="leash.description"/></td>
				</tr>
				<tr>
					<td id="slabel">ราคา:<span>*</span></td>
					<td><s:textfield name="leash.price" size="5"/>บาท</td>
				</tr>
				<tr>
					<td id="slabel">ค่าขนส่ง:</td>
					<td><s:textfield name="leash.shippingPrice" size="5"/>บาท</td>
				</tr>
				<tr>
					<td id="slabel">วัตถุดิบ:</td>
					<td><s:textfield name="leash.rawMaterial" size="50"/></td>
				</tr>
				<tr>
					<td id="slabel">กว้าง:<span>*</span></td>
					<td><s:textfield name="leash.widht" size="5"/>
					<s:select list="sizeUnit" key="leash.widhtUnit"/></td>
				</tr>
				<tr>
					<td id="slabel">ยาว:<span>*</span></td>
					<td><s:textfield name="leash.length" size="5"/>
					<s:select list="sizeUnit" key="leash.lengthUnit"/></td>
				</tr>
				<tr>
					<td id="slabel">ขนาด:</td>
					<td><s:label name="leash.thaiSize"/></td>
				</tr>
			</table>


			<div align="center" style=" padding-top: 10px;">
				<input onclick="add()" type="button" value="เพิ่ม" id="button"></input>
			</div>
		</s:form>

	</div>
</div>